<navigation:Page x:Class="Imtihan.Exam" 
                 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    d:DesignWidth="640" d:DesignHeight="300" mc:Ignorable="d"
    Style="{StaticResource PageStyle}">

    <Grid x:Name="LayoutRoot" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="20">
        <StackPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <sdk:Label Grid.Column="0" Content="Please select your exam: " />
                <ComboBox Name="cbExam" DisplayMemberPath="Name" SelectedValuePath="Id" Grid.Column="1" SelectionChanged="cbExam_SelectionChanged"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <sdk:Label Grid.Column="0" Content="Select Schedule: " />
                <sdk:DataGrid Name="dgSchedule" AutoGenerateColumns="False" Grid.Column="1">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn Header="Batch" Binding="{Binding AssessmentSchedule.Name}" />
                        <sdk:DataGridTextColumn Header="Date Time Start" Binding="{Binding AssessmentSchedule.StartDateTime}" />
                        <sdk:DataGridTextColumn Header="Date Time End" Binding="{Binding AssessmentSchedule.EndDateTime}" />
                        <sdk:DataGridTextColumn Header="Remaining Capacity" Binding="{Binding AssessmentSchedule.Capacity}" />
                        <sdk:DataGridTemplateColumn>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Name="btnRegister" Content="{Binding Command}"
                                            IsEnabled="{Binding IsCommandable}" Click="btnRegister_Click"/>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Name="btnTakeExam" Content="Take Exam" Visibility="{Binding TakeExamVisibility}" Click="btnTakeExam_Click"/>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
            </Grid>
        </StackPanel>
    </Grid>

</navigation:Page>
